"use strict";

var path = require("path");
var execFile = require("child_process").execFile;

var phantomjsCmd = require("phantomjs").path;
var converterFileName = path.resolve(__dirname, "./converter.js");
var svgFileName = path.relative(__dirname, "G:\\MetroMap\\highcharts_exports\\6fb269e28f6fc1fe4ed5d3230273d7df\\chart.svg");
var pngFileName = path.relative(__dirname, "G:\\MetroMap\\highcharts_exports\\6fb269e28f6fc1fe4ed5d3230273d7df\\chart.png");

var args = [converterFileName, svgFileName, pngFileName, 2];
console.log(svgFileName);
console.log(pngFileName);
execFile(phantomjsCmd, args, function(err, stdout, stderr) {
    console.log(stdout);
    console.log(stderr);
    if (err) {
        console.log('Err happened!');
    }
});
